package top.huxy.boot.model.dto;

import lombok.Data;
import top.huxy.boot.exception.RequestParamIllegalException;
import top.huxy.boot.util.StringUtils;

@Data
public class DTOVideoFeedback {
    private String text;
    private Integer rate;

    public void test() {
        String temp;
        if((temp= StringUtils.getEmptyParamName("text,rate",text,rate))!=null){
            throw new RequestParamIllegalException("参数["+temp+"]是必须的");
        }
        if(text.length()>666){
            throw new RequestParamIllegalException("提交内容太长");
        }
        if(rate<0||rate>5){
            throw new RequestParamIllegalException("参数不合法,rate范围0~5");
        }
    }
}
